package dnl.math.graph2d;

public class CoordinateTranslation {

	int scale;
	int coordinatesOffsetX;
	int coordinatesOffsetY;

    public int getCoordinatesOffsetX() {
        return coordinatesOffsetX;
    }

    public void setCoordinatesOffsetX(int coordinatesOffsetX) {
        this.coordinatesOffsetX = coordinatesOffsetX;
    }

    public int getCoordinatesOffsetY() {
        return coordinatesOffsetY;
    }

    public void setCoordinatesOffsetY(int coordinatesOffsetY) {
        this.coordinatesOffsetY = coordinatesOffsetY;
    }

    public int getScale() {
        return scale;
    }

    public void setScale(int scale) {
        this.scale = scale;
    }

	public CoordinateTranslation(final int scale, final int coordinatesOffsetX, final int coordinatesOffsetY) {
		this.scale = scale;
		this.coordinatesOffsetX = coordinatesOffsetX;
		this.coordinatesOffsetY = coordinatesOffsetY;
	}

	public MathCoordinatesPoint translate(final MathCoordinatesPoint p){
		MathCoordinatesPoint pp = new MathCoordinatesPoint();
		pp.x = ((p.x)*scale)+coordinatesOffsetX;
		pp.y = ((p.y)*scale)+coordinatesOffsetY;
		return pp;
	}

    public double translateSize(final double d){
		return scale * d;
	}

}
